//
//  QpCityDeatilsTableViewCell.m
//  Tour
//
//  Created by 才诗琦 on 16/3/11.
//  Copyright © 2016年 张中烨. All rights reserved.
//
// 宏定义
//#define WIDTH self.contentView.frame.size.width
#import "QpCityDeatilsTableViewCell.h"

@implementation QpCityDeatilsTableViewCell
#pragma mark - 初始化

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        //图片
        self.photo = [[UIImageView alloc] init];
        [self.contentView addSubview:_photo];
        
 //标题
        self.title = [[UILabel alloc] init];
        _title.font = [UIFont systemFontOfSize:15];
        _title.numberOfLines = 2;
        
        [self.contentView addSubview:_title];
        
        
        
        //价格
        
        self.price = [[UILabel alloc] init];
        _price.font = [UIFont systemFontOfSize:12];
        self.price.textAlignment = NSTextAlignmentRight;
        [self.contentView addSubview:_price];
        
        //折扣
        
        self.priceoff = [[UILabel alloc] init];
        _priceoff.font = [UIFont systemFontOfSize: 10];

        [self.contentView addSubview:_priceoff];
        
    }
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    
    
    self.photo.frame = CGRectMake(10, 10, 100, 100 * 200 / 300);
    _title.frame = CGRectMake(_photo.frame.size.width+ _photo.frame.origin.x + 10,5, self.contentView.frame.size.width - 120, 50);
    _priceoff.frame = CGRectMake(_title.frame.origin.x, self.contentView.frame.size.height - 15, 30, 10);
    _price.frame = CGRectMake(self.contentView.frame.size.width - 90, _priceoff.frame.origin.y, 80, 10);
    
    
    
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
